<script setup lang="ts">
import { ref } from "vue";
import { captchaAPI } from "./services/auth";
const mobile = ref("");
const getCaptcha = async () => {
  if (mobile.value) {
    const res = await captchaAPI(mobile.value);
    console.log(res);
  } else {
    alert("请输入手机号");
  }
};
</script>

<template>
  <div>
    <input
      class="txt"
      type="text"
      placeholder="请输入手机号码"
      @keyup.enter="getCaptcha"
      v-model="mobile"
    />
  </div>
</template>

<style scoped>
.txt {
  padding: 8px;
  width: 80vw;
}
</style>
